]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
cleanup: Prefer using Color struct constructor
authorBilal Elmoussaoui <belmouss@redhat.com>
Tue, 11 Jun 2024 00:15:28 +0000 (02:15 +0200)
committerMarge Bot <marge-bot@gnome.org>
Wed, 12 Jun 2024 16:09:43 +0000 (16:09 +0000)
Instead of Color.from_pixel or Color.new as both would be removed
to simplify the Color API

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3367>

js/ui/appDisplay.js
js/ui/background.js
js/ui/quickSettings.js
js/ui/windowManager.js

index 117a3864df11d8270c71e2022b187d2dbef07d1b..4283738b5deda112b6615477c73e35874e0f2868 100644 (file)
@@ -54,8 +54,8 @@ const DRAG_PAGE_SWITCH_REPEAT_TIMEOUT = 1000;
 
 const DELAYED_MOVE_TIMEOUT = 200;
 
-const DIALOG_SHADE_NORMAL = Clutter.Color.from_pixel(0x000000cc);
-const DIALOG_SHADE_HIGHLIGHT = Clutter.Color.from_pixel(0x00000055);
+const DIALOG_SHADE_NORMAL = new Clutter.Color({red: 0, green: 0, blue: 0, alpha: 204});
+const DIALOG_SHADE_HIGHLIGHT = new Clutter.Color({red: 0, green: 0, blue: 0, alpha: 85});
 
 const DEFAULT_FOLDERS = {
     'Utilities': {
@@ -2732,7 +2732,7 @@ export const AppFolderDialog = GObject.registerClass({
             this.child.get_transformed_position();
 
         this.ease({
-            background_color: Clutter.Color.from_pixel(0x00000000),
+            background_color: new Clutter.Color({red: 0, green: 0, blue: 0, alpha: 0}),
             duration: FOLDER_DIALOG_ANIMATION_TIME,
             mode: Clutter.AnimationMode.EASE_OUT_QUAD,
         });
index 8301330a4074638736a0fc36da3cfccdc8806ca2..959061308596d18a08448ee67823c0bed31f7b2d 100644 (file)
@@ -107,7 +107,7 @@ import * as LoginManager from '../misc/loginManager.js';
 import * as Main from './main.js';
 import * as Params from '../misc/params.js';
 
-const DEFAULT_BACKGROUND_COLOR = Clutter.Color.from_pixel(0x2e3436ff);
+const DEFAULT_BACKGROUND_COLOR = new Clutter.Color({red: 46, green: 52, blue: 54, alpha: 255});
 
 const BACKGROUND_SCHEMA = 'org.gnome.desktop.background';
 const PRIMARY_COLOR_KEY = 'primary-color';
index 6deff416c3aea947574213e5cfaae583eb0d310c..613055b5962154ed2dce27b97d42ff2f84d3ac76 100644 (file)
@@ -818,7 +818,12 @@ export const QuickSettingsMenu = class extends PopupMenu.PopupMenu {
 
     _setDimmed(dim) {
         const val = 127 * (1 + (dim ? 1 : 0) * DIM_BRIGHTNESS);
-        const color = Clutter.Color.new(val, val, val, 255);
+        const color = new Clutter.Color({
+            red: val,
+            green: val,
+            blue: val,
+            alpha: 255,
+        });
 
         this._boxPointer.ease_property('@effects.dim.brightness', color, {
             mode: Clutter.AnimationMode.LINEAR,
index dd67b8ea30fd7c9d4e4536c13069f0977a5069c2..e3a61f9abc119e17d50e472adc53138847728d04 100644 (file)
@@ -149,7 +149,12 @@ class WindowDimmer extends Clutter.BrightnessContrastEffect {
 
     setDimmed(dimmed, animate) {
         let val = 127 * (1 + (dimmed ? 1 : 0) * DIM_BRIGHTNESS);
-        let color = Clutter.Color.new(val, val, val, 255);
+        const color = new Clutter.Color({
+            red: val,
+            green: val,
+            blue: val,
+            alpha: 255,
+        });
 
         this.actor.ease_property(`@effects.${this.name}.brightness`, color, {
             mode: Clutter.AnimationMode.LINEAR,